<?php

include_package( 'Xml' );

class XmlDatabaseForeignKeyListElement extends XmlElement {

	function XmlDatabaseForeignKeyListElement( &$oConfiguration, $aForeignKeyList, $sSuffix = '' ) {

		if ( $sSuffix ) $this->XmlElement( 'FOREIGN_KEY_' . strtoupper( $sSuffix ). '_LIST' );
		else $this->XmlElement( 'FOREIGN_KEY' );

		foreach ( $aForeignKeyList as $oThisForeignKey ) {
			if ( $oConfiguration->GetProperty( 'ShowForeignKeysToFilteredTables' )
			   || ( !$oThisForeignKey->IsFromAFilteredTable() && !$oThisForiegnKey->IsToAFilteredTable() ) ) {
				$this->AddElement( new XmlDatabaseForeignKeyElement( $oConfiguration, $oThisForeignKey ) );
			}
		}
	}
}

require_once( 'XmlDatabaseForeignKeyElement.php' );
	
?>
